<template>
	<view class="w-100">
		<view class="flex-1 summary-box pb-2">
			<view class="flex-1 row-ac py-2">
				<view class="row-a-j-fc flex-1">	
					<view class="font-s-4"><text class="font-s-2 mr">¥</text>0</view>
					<view class="font-s-2 mt-1">今日销售</view>
				</view>
				<view class="row-a-j-fc flex-1">	
					<view class="font-s-4"><text class="font-s-2 mr">¥</text>0</view>
					<view class="font-s-2 mt-1">本月销售</view>
				</view>
				<view class="row-a-j-fc flex-1">
					<view class="font-s-4"><text class="font-s-2 mr">¥</text>0</view>
					<view class="font-s-2 mt-1">销售总额</view>
				</view>
			</view>
			<view class="flex-1 row-ac py-2">
				<view class="row-a-j-fc flex-1">	
					<view class="font-s-4">{{ stats.all_users_count }}</view>
					<view class="font-s-2 mt-1">会员量</view>
				</view>
				<view class="row-a-j-fc flex-1">	
					<view class="font-s-4">{{ stats.new_user_count }}</view>
					<view class="font-s-2 mt-1">今日新增</view>
				</view>
				<view class="row-a-j-fc flex-1">
					<!-- <view class="font-s-4"><text class="font-s-2 mr">¥</text>74365</view>
					<view class="font-s-2 mt-1">今日销售</view> -->
				</view>
			</view>
		</view>
		<view class="flex-1 mx-3 mt-3">
			<view class="flex-1 row-ac project-box mb-3" @click="navTo('/pages/user/operation/user-report')">
				<view class="row-ac flex-1">
					<view class="iconfont icon-haoyou ml-3 mr-1"></view>
					<view class="font-s-4 flex-1">用户数据</view>
				</view>
				<view class="iconfont icon-next-01 mr-3"></view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		statsUrl
	} from '@/api/index.js';
	export default {
		data() {
			return {
				stats:''
			}
		},
		onLoad() {
		    this.init()	
		},
		methods:{
			init() {
				this.getStats()
			},
			getStats() {
				this.$R.get(statsUrl).then(res => {
					if (res.code == 200) {
						this.stats = res.data
					}
				})
			},
			navTo(url){
				uni.navigateTo({
					url: url
				});
			}
		}
	}
</script>

<style lang="scss">
	.summary-box {
		background-color: #000;
		color: #fff;
	
		.divider-line {
			width: 1rpx;
			height: 60rpx;
			background-color: #fff;
		}
	}
	.project-box {
		height: 96rpx;
		border: 1rpx solid #dee2e6;
	
		.iconfont {
			font-size: 35rpx;
		}
	}
</style>